<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Home</title>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
    </head>
    <body>
        <script type="text/javascript">
    $(document).ready(function () {
    
        $("#formulario").submit(function (ev) {
            var $frm = $(this);
            ev.preventDefault();
            $.ajax({
            
                type: $frm.attr("method"),
                url: $frm.attr("action"),
                data: $frm.serialize(),
                success: function (data) {
                    $("#resultado").append(data);
                }
            });
        });
    });
</script>
</head>
<body>
    <form id="formulario" action="getToken.php" method="POST">
        <label for="user">Usuario:</label>
        <input id="user" name="user" type="text" value="" />
        <label for="pass">Password:</label>
        <input id="pass" name="pass" type="password" value="" />
        <input name="submit" type="submit" value="Enviar" />
    </form>
    <div id="resultado"></div>
</body>
</html>
